Skip to content

Feature/live chat comments#1481

Open
Ecomont wants to merge 15 commits intoTeamNewPipe:devfrom
Ecomont:feature/live-chat-comments
Open

Feature/live chat comments#1481
Ecomont wants to merge 15 commits intoTeamNewPipe:devfrom
Ecomont:feature/live-chat-comments

Conversation

@Ecomont
Copy link
Copy Markdown
Contributor

@Ecomont Ecomont commented Apr 24, 2026

This PR adds support for extracting YouTube live chat messages and exposing them through the existing comments API. When a live stream has regular comments disabled, the extractor now falls back to fetching live chat messages instead.

Changes

  • CommentsExtractor / CommentsInfo: Added isLiveChat() flag to distinguish live chat from regular comments.
  • YoutubeCommentsExtractor: Added findLiveChatContinuation() and fetchLiveChat() to retrieve live chat via the live_chat/get_live_chat endpoint.
  • YoutubeLiveChatInfoItemExtractor: New extractor that maps liveChatTextMessageRenderer JSON to CommentsInfoItem, with proper emoji run handling.
  • Page routing: Live chat continuations are marked with a live_chat page identifier so getPage() routes correctly on subsequent extractor instances.

Implementation notes

The approach is based on the live chat implementation in PipePipe, adapted to fit the NewPipe Extractor architecture. Key adaptations include:

  • Reusing the existing CommentsInfoItem type instead of introducing a separate live chat item class.
  • Proper isLiveStream flag handling to avoid hitting the replay endpoint on fresh extractors.
  • Emoji extraction with fallback chain: emojiIdshortcuts[]searchTerms[][emoji].

Checklist

  • I carefully read the contribution guidelines and agree to them.
  • I have tested the API against NewPipe.
  • I agree to create a pull request for NewPipe as soon as possible to make it compatible with the changed API.

@TobiGr TobiGr added enhancement New feature or request YouTube Service, https://www.youtube.com/ labels Apr 24, 2026
Copy link
Copy Markdown
Member

@absurdlylongusername absurdlylongusername left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do proper review later, but for now:

Please add tests. We should not be adding any new functionality to the extractor without adequate testing.

@sonarqubecloud
Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request YouTube Service, https://www.youtube.com/

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants